package com.powernode.mapper;

import com.powernode.domain.SysLoginUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author dljd
* @description 针对表【sys_user(系统用户)】的数据库操作Mapper
* @createDate 2023-10-24 09:09:23
* @Entity com.powernode.domain.SysLoginUser
*/
public interface SysLoginUserMapper extends BaseMapper<SysLoginUser> {
    @Select("select distinct t1.perms,1 from sys_menu t1\n" +
            "left join sys_role_menu t2 on t1.menu_id = t2.menu_id\n" +
            "left join sys_user_role t3 on t2.role_id = t3.role_id\n" +
            "where t3.user_id = #{userId} and t1.perms != ''")
    List<String> loadUserPerms(Long userId);
}




